# -*- coding:utf-8 -*-
# @Author: shenyuyu
# @Time: 2023/6/30 9:46
# @File: qu_2_spark_on_hive.py
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StringType, IntegerType
from pyspark.sql import functions as F

if __name__ == '__main__':
    spark = SparkSession.builder.appName("a").master("local[*]")\
        .config("spark.sql.shuffle.partitions", "2") \
        .config("spark.sql.warehouse.dir", "hdfs://hadoop1:9820/user/hive/warehouse")\
        .config("hive.metastore.uris", "thrift://hadoop1:9083") \
        .enableHiveSupport().getOrCreate()

    spark.sql("show tables").show()